'''
Created on 10/01/2011

@author: jguerrer
'''

class HalfEdge(object):
    '''
    classdocs
    '''

  


    def __init__(self,id,origin, twin, incidentFace,next,prev,end):
        '''
        Constructor
        '''
        self.id=id
        self.origin = origin
        self.twin    = twin
        self.incidentFace = incidentFace
        self.next = next
        self.prev = prev
        self.end = end

    def toString(self):
        info = str(self.id) 
        if not self.origin == None:
            info = info + "\t\tOrigin: " + self.origin.id
        if not self.end == None:
            info = info + "\t\tEND: " + self.end.id
        if not self.twin == None:
            
            info = info + "\t\tTWIN: " + self.twin.id
        if not self.incidentFace == None:
            info = info + "\t\tIF: " + self.incidentFace.id
        if not self.next == None:
            info = info + "\t\tNEXT: " + self.next.id
        if not self.prev == None:
            info = info + "\t\tPREV: " + self.prev.id
        
        return info
        
    def equals(self,otherHalfEdge):
        if self.origin == otherHalfEdge.origin & self.next == otherHalfEdge.next :
            return True
        else:
            return False
        
